# -*- coding: utf-8 -*-
"""
date: Mon Dec 17 14:19:18 2018
python: Anaconda 3.6.5
author: kanade
email: kanade@blisst.cn
"""
import numpy as np
import matplotlib.pyplot as mp
from mpl_toolkits.mplot3d import axes3d


n = 1000
# 符合正态分布随机值
x = np.random.normal(0, 1, n)
y = np.random.normal(0, 1, n)
z = np.random.normal(0, 1, n)
# 到圆点的距离
d = np.sqrt(x ** 2 + y ** 2 + z ** 2)

mp.figure('3D Scatter')
ax = mp.gca(projection='3d')  # 创建三维坐标系
mp.title('3D Scatter', fontsize=20)

ax.set_xlabel('x', fontsize=14)
ax.set_ylabel('y', fontsize=14)
ax.set_zlabel('z', fontsize=14)

ax.scatter(x, y, z, s=60, c=d, cmap='jet_r',
           alpha=0.5)

mp.show()
